package top.stmo.stmoBlog.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import top.stmo.stmoBlog.dao.vo.ArtivleVo;
import top.stmo.stmoBlog.service.ArticleService;

import java.util.List;

@Controller
public class IndexController {

    @Autowired
    private ArticleService articleService;

    @GetMapping({"/","index"})
    public String index(Model model) {

        List<ArtivleVo> articleVoList = articleService.findIndexArticle();
        model.addAttribute("articleVoList",articleVoList);
        return "index";
    }

}
